package com.wanmait.demo.controller.workercontroller;

import com.wanmait.demo.mapper.ControlRegionMapper;
import com.wanmait.demo.pojo.ControlRegion;
import com.wanmait.demo.pojo.OrderComment;
import com.wanmait.demo.service.ControlRegionService;
import com.wanmait.demo.service.OrderCommentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class UserController {
    @Resource
    private ControlRegionService controlRegionService;
    @Resource
    private OrderCommentService orderCommentService;

    //闫应鹏 工人个人中心
    @RequestMapping("getWorkerUser")
    public ModelAndView getWorkerUser()
    {

        ModelAndView modelAndView=new ModelAndView();
        List<ControlRegion> controlRegions=controlRegionService.findByWorkerId(1);
        List<OrderComment> orderComments=orderCommentService.findComment(1);
        modelAndView.addObject("controlRegions",controlRegions);
        modelAndView.addObject("orderComments",orderComments);
        modelAndView.setViewName("worker/user");
        return  modelAndView;
    }
}
